package gen_b2g.game.bean;

import java.io.*;
import java.util.*;

import com.bowlong.util.*;

@SuppressWarnings({ "rawtypes", "unchecked" })
public class NInt extends com.bowlong.net.proto.N3Support {
    public static final int _CID = 2397377;

    public int v; 

    public NInt setNInt(int v){
        this.v = v;
        return this;
    }

    public NInt(){}

    public NInt(int v){
        this.v = v;
    }

    public NInt(NewMap map2) {
        this.v = map2.getInt(118);
    }


    public Map _cacheResult;
    public Map toMap() {
        if(_cacheResult != null && !_cacheResult.isEmpty())
           return _cacheResult;
        Map r = new HashMap();
        r.put(-1, _CID);
        r.put(118, v);
        return r;
    }


    public static NInt parse(NewMap map2) {
        NInt r = new NInt(map2);
        return r;
    }


    public static NInt parse(NewMap map2, NInt r) {
        if(map2 == null) return null;

        r.v = map2.getInt(118);
        return r;
    }

    public String toString() {
        return "NInt[v=" + v + "]";
    }

    public static NInt parse(byte[] buf) throws Exception {
        Map<Object, Object> map = com.bowlong.bio3.B3Helper.parseMap(buf);
        NewMap map2 = NewMap.create(map);
        return parse(map2);
    }

    public static NInt parse(InputStream in) throws Exception {
        Map<Object, Object> map = com.bowlong.bio3.B3Helper.parseMap(in);
        NewMap map2 = NewMap.create(map);
        return parse(map2);
    }

    public byte[] toByteArray() throws Exception {
        return com.bowlong.bio3.B3Helper.toBytes(toMap());
    }

}
